package com.winter.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.winter.model.FinUnderline;
import com.winter.model.vo.request.OfflineRequestVo;
import com.winter.service.FinUnderlineService;
import com.winter.util.Result;

@RestController
@RequestMapping("v1/fin_underline")
public class FinUnderlineController {

    @Autowired
    public FinUnderlineService finUnderlineService;

    /**
     * 查询报价平台线下List信息
     */
    @GetMapping("/finUnderlineList")
    public Result finUnderlineList(Integer pageNumber, Integer pageSize, String direct, String fund_mode, String termUnit, String rateUnit, String userNo, String sortName, String sort,String key) {

        return finUnderlineService.finUList(pageNumber, pageSize, direct, fund_mode, termUnit, rateUnit, userNo, sortName, sort, key);
    }

    /**
     * 通过id查询报价平台线下信息
     */
    @GetMapping("/finUnderlineId")
    public Result finUnderlineId(Long id, String userNo) {
        return finUnderlineService.getFinUnderlineId(id, userNo);
    }

    /**
     * 新增报价平台线下信息
     */
    @PostMapping("/insertFinUnderline")
    public Result insertFinUnderline(@RequestBody OfflineRequestVo offlineRequestVo) {

        return finUnderlineService.insertFinUnderline(offlineRequestVo);
    }

    /**
     * 修改报价平台线下信息
     */
    @PutMapping("/updateFinUnderline")
    public Result updateFinUnderline(@RequestBody FinUnderline finUnderline) {

        return finUnderlineService.updateFinUnderline(finUnderline);
    }
}
